<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>Make Synoptic Module Stage</title>
<link href="../docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
		<meta name="viewport" content="width=device-width initial-scale=1">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="Content-Language" content="en-gb">

<link href="../docs-assets/Contents.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Progress.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Navigation.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Fonts.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Base.css" rel="stylesheet" rev="stylesheet" type="text/css">
<script>
function togglePopup(material_id) {
  var popup = document.getElementById(material_id);
  popup.classList.toggle("show");
}
</script>

<link href="../docs-assets/Popups.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
		
	</head>
	<body class="commentary-font">
		<nav role="navigation">
		<h1><a href="../index.html"><img src="../docs-assets/Inform.png" height=72> </a></h1>
<ul><li><a href="../index.html">home</a></li>
</ul><h2>Compiler</h2><ul>
<li><a href="../structure.html">structure</a></li>
<li><a href="../inbuildn.html">inbuild</a></li>
<li><a href="../inform7n.html">inform7</a></li>
<li><a href="../intern.html">inter</a></li>
<li><a href="../services.html">services</a></li>
<li><a href="../secrets.html">secrets</a></li>
</ul><h2>Other Tools</h2><ul>
<li><a href="../inblorbn.html">inblorb</a></li>
<li><a href="../inform6.html">inform6</a></li>
<li><a href="../inpolicyn.html">inpolicy</a></li>
</ul><h2>Resources</h2><ul>
<li><a href="../extensions.html">extensions</a></li>
<li><a href="../kits.html">kits</a></li>
</ul><h2>Repository</h2><ul>
<li><a href="https://github.com/ganelson/inform"><img src="../docs-assets/github.png" height=0> github</a></li>
</ul><h2>Related Projects</h2><ul>
<li><a href="https://github.com/ganelson/inweb"><img src="../docs-assets/github.png" height=0> inweb</a></li>
<li><a href="https://github.com/ganelson/intest"><img src="../docs-assets/github.png" height=0> intest</a></li>
</ul>
		</nav>
		<main role="main">
		<!-- Weave of 'Make Synoptic Module Stage' generated by inweb -->
<div class="breadcrumbs">
    <ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="../intern.html">Inter Modules</a></li><li><a href="index.html">pipeline</a></li><li><a href="index.html#5">Chapter 5: Synoptic Module</a></li><li><b>Make Synoptic Module Stage</b></li></ul></div>
<p class="purpose">Creating a top-level module of synoptic resources.</p>

<p class="commentary firstcommentary"><a id="SP1" class="paragraph-anchor"></a><b>&#167;1. </b>At this point the tree contains one module for each compilation unit included
in the link: which is a fancy way of saying, it contains one module for the
main source text, one for each extension, and one each for each kit included.
</p>

<p class="commentary">We now add one final module, <span class="extract"><span class="extract-syntax">/main/synoptic</span></span>, which contains resources compiled
together from all of the others.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">MakeSynopticModuleStage::create_pipeline_stage</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">MakeSynopticModuleStage::create_pipeline_stage</span></span>:<br/>Parsing Pipelines - <a href="2-pp.html#SP10">&#167;10</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">void</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><a href="2-pp.html#SP3" class="function-link"><span class="function-syntax">ParsingPipelines::new_stage</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"make-synoptic-module"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><a href="5-msms.html#SP1" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::run</span></a><span class="plain-syntax">, </span><span class="constant-syntax">NO_STAGE_ARG</span><span class="plain-syntax">, </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">MakeSynopticModuleStage::run</span><span class="plain-syntax">(</span><span class="reserved-syntax">pipeline_step</span><span class="plain-syntax"> *</span><span class="identifier-syntax">step</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax"> = </span><span class="identifier-syntax">step</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">ephemera</span><span class="plain-syntax">.</span><span class="element-syntax">tree</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">tree_inventory</span><span class="plain-syntax"> *</span><span class="identifier-syntax">inv</span><span class="plain-syntax"> = </span><a href="5-msms.html#SP5" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::take_inventory_cached</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><a href="5-sh.html#SP1" class="function-link"><span class="function-syntax">SynopticHierarchy::establish</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">); </span><span class="comment-syntax"> in case this has not already been done</span>
<span class="plain-syntax">    </span><a href="4-tsk.html#SP1" class="function-link"><span class="function-syntax">KitHierarchy::establish</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">); </span><span class="comment-syntax"> likewise</span>

<span class="plain-syntax">    </span><a href="5-lt.html#SP1" class="function-link"><span class="function-syntax">SynopticText::compile</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="identifier-syntax">inv</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="5-act2.html#SP1" class="function-link"><span class="function-syntax">SynopticActions::compile</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="identifier-syntax">inv</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="5-act.html#SP1" class="function-link"><span class="function-syntax">SynopticActivities::compile</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="identifier-syntax">inv</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="5-chr.html#SP1" class="function-link"><span class="function-syntax">SynopticChronology::compile</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="identifier-syntax">inv</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="5-ext.html#SP1" class="function-link"><span class="function-syntax">SynopticExtensions::compile</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="identifier-syntax">inv</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="5-ins.html#SP1" class="function-link"><span class="function-syntax">SynopticInstances::compile</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="identifier-syntax">inv</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="5-dlg.html#SP1" class="function-link"><span class="function-syntax">SynopticDialogue::compile</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="identifier-syntax">inv</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="5-knd.html#SP1" class="function-link"><span class="function-syntax">SynopticKinds::compile</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="identifier-syntax">inv</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="5-mlt.html#SP1" class="function-link"><span class="function-syntax">SynopticMultimedia::compile</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="identifier-syntax">inv</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="5-prp.html#SP1" class="function-link"><span class="function-syntax">SynopticProperties::compile</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="identifier-syntax">inv</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="5-rlt.html#SP1" class="function-link"><span class="function-syntax">SynopticRelations::compile</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="identifier-syntax">inv</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="5-rsp.html#SP1" class="function-link"><span class="function-syntax">SynopticResponses::compile</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="identifier-syntax">inv</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="5-rls.html#SP1" class="function-link"><span class="function-syntax">SynopticRules::compile</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="identifier-syntax">inv</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="5-scn.html#SP1" class="function-link"><span class="function-syntax">SynopticScenes::compile</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="identifier-syntax">inv</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="5-tbl.html#SP1" class="function-link"><span class="function-syntax">SynopticTables::compile</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="identifier-syntax">inv</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="5-uo.html#SP1" class="function-link"><span class="function-syntax">SynopticUseOptions::compile</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="identifier-syntax">inv</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="5-vrb.html#SP1" class="function-link"><span class="function-syntax">SynopticVerbs::compile</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="identifier-syntax">inv</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="5-tst.html#SP1" class="function-link"><span class="function-syntax">SynopticTests::compile</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="identifier-syntax">inv</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">Wiring::connect_plugs_to_sockets</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP2" class="paragraph-anchor"></a><b>&#167;2. </b>The inventory for an Inter tree is an itemisation of packages with particular
types: for example, we can ask it to hold a list of <span class="extract"><span class="extract-syntax">_activity</span></span> packages.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">typedef</span><span class="plain-syntax"> </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">tree_inventory</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">of_tree</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">linked_list</span><span class="plain-syntax"> *</span><span class="identifier-syntax">items</span><span class="plain-syntax">; </span><span class="comment-syntax"> of </span><span class="extract"><span class="extract-syntax">tree_inventory_item</span></span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">text_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">module_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">response_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">rulebook_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">rule_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">activity_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">action_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">property_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">extension_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">relation_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">table_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">table_column_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">table_column_usage_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">action_history_condition_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">past_tense_condition_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">instance_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">scene_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">file_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">internal_file_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">figure_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">sound_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">use_option_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">verb_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">modal_verb_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">verb_form_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">preposition_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">adjective_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">derived_kind_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">kind_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">test_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">named_action_pattern_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">variable_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">equation_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">heading_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">multiplication_rule_nodes</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">CLASS_DEFINITION</span>
<span class="plain-syntax">} </span><span class="reserved-syntax">tree_inventory</span><span class="plain-syntax">;</span>

<span class="reserved-syntax">typedef</span><span class="plain-syntax"> </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">tree_inventory_item</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="identifier-syntax">node_list</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">required_ptype</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">CLASS_DEFINITION</span>
<span class="plain-syntax">} </span><span class="reserved-syntax">tree_inventory_item</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>The structure tree_inventory is accessed in 5/ext, 5/lt, 5/rsp, 5/rls, 5/act, 5/act2, 5/ins, 5/dlg, 5/knd, 5/prp, 5/rlt, 5/tbl, 5/chr, 5/scn, 5/mlt, 5/uo, 5/vrb, 5/tst and here.</li><li>The structure tree_inventory_item is private to this section.</li></ul>
<p class="commentary firstcommentary"><a id="SP3" class="paragraph-anchor"></a><b>&#167;3. </b>Creating one of these is quick enough: when created, it's just a list of
requirements.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">tree_inventory</span><span class="plain-syntax"> *</span><span class="function-syntax">MakeSynopticModuleStage::new_inventory</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">MakeSynopticModuleStage::new_inventory</span></span>:<br/><a href="5-msms.html#SP4">&#167;4</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">tree_inventory</span><span class="plain-syntax"> *</span><span class="identifier-syntax">inv</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CREATE</span><span class="plain-syntax">(</span><span class="reserved-syntax">tree_inventory</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">of_tree</span><span class="plain-syntax"> = </span><span class="identifier-syntax">I</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">items</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NEW_LINKED_LIST</span><span class="plain-syntax">(</span><span class="reserved-syntax">tree_inventory_item</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">text_nodes</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterNodeList::new_array</span><span class="plain-syntax">();</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">response_nodes</span><span class="plain-syntax"> = </span><a href="5-msms.html#SP3" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::needs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_response"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">rulebook_nodes</span><span class="plain-syntax"> = </span><a href="5-msms.html#SP3" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::needs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_rulebook"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">rule_nodes</span><span class="plain-syntax"> = </span><a href="5-msms.html#SP3" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::needs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_rule"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">activity_nodes</span><span class="plain-syntax"> = </span><a href="5-msms.html#SP3" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::needs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_activity"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">action_nodes</span><span class="plain-syntax"> = </span><a href="5-msms.html#SP3" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::needs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_action"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">property_nodes</span><span class="plain-syntax"> = </span><a href="5-msms.html#SP3" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::needs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_property"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">relation_nodes</span><span class="plain-syntax"> = </span><a href="5-msms.html#SP3" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::needs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_relation"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">table_nodes</span><span class="plain-syntax"> = </span><a href="5-msms.html#SP3" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::needs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_table"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">table_column_nodes</span><span class="plain-syntax"> = </span><a href="5-msms.html#SP3" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::needs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_table_column"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">table_column_usage_nodes</span><span class="plain-syntax"> = </span><a href="5-msms.html#SP3" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::needs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_table_column_usage"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">action_history_condition_nodes</span><span class="plain-syntax"> = </span><a href="5-msms.html#SP3" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::needs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_action_history_condition"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">past_tense_condition_nodes</span><span class="plain-syntax"> = </span><a href="5-msms.html#SP3" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::needs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_past_condition"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">use_option_nodes</span><span class="plain-syntax"> = </span><a href="5-msms.html#SP3" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::needs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_use_option"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">verb_nodes</span><span class="plain-syntax"> = </span><a href="5-msms.html#SP3" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::needs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_verb"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">modal_verb_nodes</span><span class="plain-syntax"> = </span><a href="5-msms.html#SP3" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::needs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_modal_verb"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">verb_form_nodes</span><span class="plain-syntax"> = </span><a href="5-msms.html#SP3" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::needs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_verb_form"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">preposition_nodes</span><span class="plain-syntax"> = </span><a href="5-msms.html#SP3" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::needs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_preposition"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">adjective_nodes</span><span class="plain-syntax"> = </span><a href="5-msms.html#SP3" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::needs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_adjective"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">derived_kind_nodes</span><span class="plain-syntax"> = </span><a href="5-msms.html#SP3" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::needs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_derived_kind"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">kind_nodes</span><span class="plain-syntax"> = </span><a href="5-msms.html#SP3" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::needs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_kind"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">module_nodes</span><span class="plain-syntax"> = </span><a href="5-msms.html#SP3" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::needs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_module"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">instance_nodes</span><span class="plain-syntax"> = </span><a href="5-msms.html#SP3" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::needs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_instance"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">test_nodes</span><span class="plain-syntax"> = </span><a href="5-msms.html#SP3" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::needs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_test"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">named_action_pattern_nodes</span><span class="plain-syntax"> = </span><a href="5-msms.html#SP3" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::needs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_named_action_pattern"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">variable_nodes</span><span class="plain-syntax"> = </span><a href="5-msms.html#SP3" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::needs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_variable"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">equation_nodes</span><span class="plain-syntax"> = </span><a href="5-msms.html#SP3" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::needs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_equation"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">heading_nodes</span><span class="plain-syntax"> = </span><a href="5-msms.html#SP3" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::needs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_heading"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">multiplication_rule_nodes</span><span class="plain-syntax"> = </span><a href="5-msms.html#SP3" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::needs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_multiplication_rule"</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">extension_nodes</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterNodeList::new_array</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">scene_nodes</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterNodeList::new_array</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">file_nodes</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterNodeList::new_array</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">internal_file_nodes</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterNodeList::new_array</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">figure_nodes</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterNodeList::new_array</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">sound_nodes</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterNodeList::new_array</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">inv</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="identifier-syntax">inter_node_array</span><span class="plain-syntax"> *</span><span class="function-syntax">MakeSynopticModuleStage::needs</span><span class="plain-syntax">(</span><span class="reserved-syntax">tree_inventory</span><span class="plain-syntax"> *</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pt</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">tree_inventory_item</span><span class="plain-syntax"> *</span><span class="identifier-syntax">item</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CREATE</span><span class="plain-syntax">(</span><span class="reserved-syntax">tree_inventory_item</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">item</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">node_list</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterNodeList::new_array</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">item</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">required_ptype</span><span class="plain-syntax"> = </span><span class="identifier-syntax">LargeScale::package_type</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">of_tree</span><span class="plain-syntax">, </span><span class="identifier-syntax">pt</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">ADD_TO_LINKED_LIST</span><span class="plain-syntax">(</span><span class="identifier-syntax">item</span><span class="plain-syntax">, </span><span class="reserved-syntax">tree_inventory_item</span><span class="plain-syntax">, </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">items</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">item</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">node_list</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP4" class="paragraph-anchor"></a><b>&#167;4. </b>The expensive part comes later, when we traverse the Inter tree and add
interesting packages to one of the lists.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">tree_inventory</span><span class="plain-syntax"> *</span><span class="function-syntax">MakeSynopticModuleStage::take_inventory</span><button class="popup" onclick="togglePopup('usagePopup3')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup3">Usage of <span class="code-font"><span class="function-syntax">MakeSynopticModuleStage::take_inventory</span></span>:<br/><a href="5-msms.html#SP5">&#167;5</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">tree_inventory</span><span class="plain-syntax"> *</span><span class="identifier-syntax">inv</span><span class="plain-syntax"> = </span><a href="5-msms.html#SP3" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::new_inventory</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">InterTree::traverse</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><a href="5-msms.html#SP4" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::visitor</span></a><span class="plain-syntax">, </span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">i</span><span class="function-syntax">&lt;InterNodeList::array_len(inv-&gt;</span><span class="element-syntax">module_nodes</span><span class="plain-syntax">); </span><span class="identifier-syntax">i</span><span class="plain-syntax">++) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pack</span><span class="plain-syntax"> = </span><span class="identifier-syntax">PackageInstruction::at_this_head</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">module_nodes</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">list</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">].</span><span class="identifier-syntax">node</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">InterSymbolsTable::symbol_from_name</span><span class="plain-syntax">(</span><span class="identifier-syntax">InterPackage::scope</span><span class="plain-syntax">(</span><span class="identifier-syntax">pack</span><span class="plain-syntax">), </span><span class="identifier-syntax">I</span><span class="string-syntax">"extension_id"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">InterNodeList::array_add</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">extension_nodes</span><span class="plain-syntax">, </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">module_nodes</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">list</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">].</span><span class="identifier-syntax">node</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">i</span><span class="function-syntax">&lt;InterNodeList::array_len(inv-&gt;</span><span class="element-syntax">instance_nodes</span><span class="plain-syntax">); </span><span class="identifier-syntax">i</span><span class="plain-syntax">++) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pack</span><span class="plain-syntax"> = </span><span class="identifier-syntax">PackageInstruction::at_this_head</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">instance_nodes</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">list</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">].</span><span class="identifier-syntax">node</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Metadata::exists</span><span class="plain-syntax">(</span><span class="identifier-syntax">pack</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"^is_scene"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">InterNodeList::array_add</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">scene_nodes</span><span class="plain-syntax">, </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">instance_nodes</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">list</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">].</span><span class="identifier-syntax">node</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Metadata::exists</span><span class="plain-syntax">(</span><span class="identifier-syntax">pack</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"^is_file"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">InterNodeList::array_add</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">file_nodes</span><span class="plain-syntax">, </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">instance_nodes</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">list</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">].</span><span class="identifier-syntax">node</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Metadata::exists</span><span class="plain-syntax">(</span><span class="identifier-syntax">pack</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"^is_internal_file"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">InterNodeList::array_add</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">internal_file_nodes</span><span class="plain-syntax">, </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">instance_nodes</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">list</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">].</span><span class="identifier-syntax">node</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Metadata::exists</span><span class="plain-syntax">(</span><span class="identifier-syntax">pack</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"^is_figure"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">InterNodeList::array_add</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">figure_nodes</span><span class="plain-syntax">, </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">instance_nodes</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">list</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">].</span><span class="identifier-syntax">node</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Metadata::exists</span><span class="plain-syntax">(</span><span class="identifier-syntax">pack</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"^is_sound"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">InterNodeList::array_add</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">sound_nodes</span><span class="plain-syntax">, </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">instance_nodes</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">list</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">].</span><span class="identifier-syntax">node</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">inv</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">MakeSynopticModuleStage::visitor</span><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">inter_tree_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="reserved-syntax">void</span><span class="plain-syntax"> *</span><span class="identifier-syntax">state</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">tree_inventory</span><span class="plain-syntax"> *</span><span class="identifier-syntax">inv</span><span class="plain-syntax"> = (</span><span class="reserved-syntax">tree_inventory</span><span class="plain-syntax"> *) </span><span class="identifier-syntax">state</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Inode::is</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="identifier-syntax">CONSTANT_IST</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">con_s</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">InterSymbolsTable::symbol_from_ID_at_node</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="identifier-syntax">DEFN_CONST_IFLD</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_type</span><span class="plain-syntax"> </span><span class="identifier-syntax">type</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterTypes::of_symbol</span><span class="plain-syntax">(</span><span class="identifier-syntax">con_s</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">InterTypes::type_name</span><span class="plain-syntax">(</span><span class="identifier-syntax">type</span><span class="plain-syntax">) ==</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">InterTypes::type_name</span><span class="plain-syntax">(</span><span class="identifier-syntax">LargeScale::text_literal_type</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">)))</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">InterNodeList::array_add</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">text_nodes</span><span class="plain-syntax">, </span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Inode::is</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="identifier-syntax">PACKAGE_IST</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pack</span><span class="plain-syntax"> = </span><span class="identifier-syntax">PackageInstruction::at_this_head</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ptype</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterPackage::type</span><span class="plain-syntax">(</span><span class="identifier-syntax">pack</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">tree_inventory_item</span><span class="plain-syntax"> *</span><span class="identifier-syntax">item</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">LOOP_OVER_LINKED_LIST</span><span class="plain-syntax">(</span><span class="identifier-syntax">item</span><span class="plain-syntax">, </span><span class="reserved-syntax">tree_inventory_item</span><span class="plain-syntax">, </span><span class="identifier-syntax">inv</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">items</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ptype</span><span class="plain-syntax"> == </span><span class="identifier-syntax">item</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">required_ptype</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">InterNodeList::array_add</span><span class="plain-syntax">(</span><span class="identifier-syntax">item</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">node_list</span><span class="plain-syntax">, </span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP5" class="paragraph-anchor"></a><b>&#167;5. </b>Calling <a href="5-msms.html#SP4" class="internal">MakeSynopticModuleStage::take_inventory</a> is potentially slow, so
we also offer a version which caches the results:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">tree_inventory</span><span class="plain-syntax"> *</span><span class="identifier-syntax">cached_inventory</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">cache_is_for</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">tree_inventory</span><span class="plain-syntax"> *</span><span class="function-syntax">MakeSynopticModuleStage::take_inventory_cached</span><button class="popup" onclick="togglePopup('usagePopup4')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup4">Usage of <span class="code-font"><span class="function-syntax">MakeSynopticModuleStage::take_inventory_cached</span></span>:<br/><a href="5-msms.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">cache_is_for</span><span class="plain-syntax"> == </span><span class="identifier-syntax">I</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">cached_inventory</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">cache_is_for</span><span class="plain-syntax"> = </span><span class="identifier-syntax">I</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">cached_inventory</span><span class="plain-syntax"> = </span><a href="5-msms.html#SP4" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::take_inventory</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">cached_inventory</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP6" class="paragraph-anchor"></a><b>&#167;6. </b>This macro conveniently loops through packages in the case when the node
array contains package head nodes, as in the above inventories:
</p>

<pre class="definitions code-font"><span class="definition-keyword">define</span> <span class="identifier-syntax">LOOP_OVER_INVENTORY_PACKAGES</span><span class="plain-syntax">(</span><span class="identifier-syntax">pack</span><span class="plain-syntax">, </span><span class="identifier-syntax">i</span><span class="plain-syntax">, </span><span class="identifier-syntax">node_list</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">i</span><span class="plain-syntax">&lt;</span><span class="identifier-syntax">InterNodeList::array_len</span><span class="plain-syntax">(</span><span class="identifier-syntax">node_list</span><span class="plain-syntax">); </span><span class="identifier-syntax">i</span><span class="plain-syntax">++)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">pack</span><span class="plain-syntax"> = </span><span class="identifier-syntax">PackageInstruction::at_this_head</span><span class="plain-syntax">(</span><span class="identifier-syntax">node_list</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">list</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">].</span><span class="identifier-syntax">node</span><span class="plain-syntax">)))</span>
</pre>
<p class="commentary firstcommentary"><a id="SP7" class="paragraph-anchor"></a><b>&#167;7. </b>The following are used for sorting.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">MakeSynopticModuleStage::module_order</span><button class="popup" onclick="togglePopup('usagePopup5')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup5">Usage of <span class="code-font"><span class="function-syntax">MakeSynopticModuleStage::module_order</span></span>:<br/>Rules - <a href="5-rls.html#SP1_1">&#167;1.1</a><br/>Activities - <a href="5-act.html#SP1_1">&#167;1.1</a><br/>Actions - <a href="5-act2.html#SP1_1">&#167;1.1</a><br/>Instances - <a href="5-ins.html#SP1">&#167;1</a><br/>Dialogue - <a href="5-dlg.html#SP1">&#167;1</a><br/>Kinds - <a href="5-knd.html#SP1">&#167;1</a>, <a href="5-knd.html#SP1_1">&#167;1.1</a><br/>Properties - <a href="5-prp.html#SP1_1">&#167;1.1</a><br/>Relations - <a href="5-rlt.html#SP1_1">&#167;1.1</a><br/>Tables - <a href="5-tbl.html#SP1">&#167;1</a>, <a href="5-tbl.html#SP1_1">&#167;1.1</a>, <a href="5-tbl.html#SP1_2">&#167;1.2</a><br/>Chronology - <a href="5-chr.html#SP1_1">&#167;1.1</a>, <a href="5-chr.html#SP1_2">&#167;1.2</a><br/>Scenes - <a href="5-scn.html#SP1">&#167;1</a><br/>Multimedia - <a href="5-mlt.html#SP1">&#167;1</a><br/>Use Options - <a href="5-uo.html#SP1_1">&#167;1.1</a><br/>Tests - <a href="5-tst.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">const</span><span class="plain-syntax"> </span><span class="reserved-syntax">void</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ent1</span><span class="plain-syntax">, </span><span class="reserved-syntax">const</span><span class="plain-syntax"> </span><span class="reserved-syntax">void</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ent2</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">ina_entry</span><span class="plain-syntax"> *</span><span class="identifier-syntax">E1</span><span class="plain-syntax"> = (</span><span class="identifier-syntax">ina_entry</span><span class="plain-syntax"> *) </span><span class="identifier-syntax">ent1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">ina_entry</span><span class="plain-syntax"> *</span><span class="identifier-syntax">E2</span><span class="plain-syntax"> = (</span><span class="identifier-syntax">ina_entry</span><span class="plain-syntax"> *) </span><span class="identifier-syntax">ent2</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">E1</span><span class="plain-syntax"> == </span><span class="identifier-syntax">E2</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_tree_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">P1</span><span class="plain-syntax"> = </span><span class="identifier-syntax">E1</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">node</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_tree_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">P2</span><span class="plain-syntax"> = </span><span class="identifier-syntax">E2</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">node</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">mod1</span><span class="plain-syntax"> = </span><a href="5-msms.html#SP7" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::module_containing</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">P1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">mod2</span><span class="plain-syntax"> = </span><a href="5-msms.html#SP7" class="function-link"><span class="function-syntax">MakeSynopticModuleStage::module_containing</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">P2</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">C1</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Metadata::read_optional_numeric</span><span class="plain-syntax">(</span><span class="identifier-syntax">mod1</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"^category"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">C2</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Metadata::read_optional_numeric</span><span class="plain-syntax">(</span><span class="identifier-syntax">mod2</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"^category"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">d</span><span class="plain-syntax"> = ((</span><span class="reserved-syntax">int</span><span class="plain-syntax">) </span><span class="identifier-syntax">C2</span><span class="plain-syntax">) - ((</span><span class="reserved-syntax">int</span><span class="plain-syntax">) </span><span class="identifier-syntax">C1</span><span class="plain-syntax">); </span><span class="comment-syntax"> larger values sort earlier</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">d</span><span class="plain-syntax"> != </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">d</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">E1</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax"> - </span><span class="identifier-syntax">E2</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">; </span><span class="comment-syntax"> smaller values sort earlier</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">MakeSynopticModuleStage::category_order</span><button class="popup" onclick="togglePopup('usagePopup6')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup6">Usage of <span class="code-font"><span class="function-syntax">MakeSynopticModuleStage::category_order</span></span>:<br/>Extensions - <a href="5-ext.html#SP1_1">&#167;1.1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">const</span><span class="plain-syntax"> </span><span class="reserved-syntax">void</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ent1</span><span class="plain-syntax">, </span><span class="reserved-syntax">const</span><span class="plain-syntax"> </span><span class="reserved-syntax">void</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ent2</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">ina_entry</span><span class="plain-syntax"> *</span><span class="identifier-syntax">E1</span><span class="plain-syntax"> = (</span><span class="identifier-syntax">ina_entry</span><span class="plain-syntax"> *) </span><span class="identifier-syntax">ent1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">ina_entry</span><span class="plain-syntax"> *</span><span class="identifier-syntax">E2</span><span class="plain-syntax"> = (</span><span class="identifier-syntax">ina_entry</span><span class="plain-syntax"> *) </span><span class="identifier-syntax">ent2</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">E1</span><span class="plain-syntax"> == </span><span class="identifier-syntax">E2</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_tree_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">P1</span><span class="plain-syntax"> = </span><span class="identifier-syntax">E1</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">node</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_tree_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">P2</span><span class="plain-syntax"> = </span><span class="identifier-syntax">E2</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">node</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">mod1</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterPackage::container</span><span class="plain-syntax">(</span><span class="identifier-syntax">P1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">mod2</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterPackage::container</span><span class="plain-syntax">(</span><span class="identifier-syntax">P2</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">C1</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Metadata::read_optional_numeric</span><span class="plain-syntax">(</span><span class="identifier-syntax">mod1</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"^category"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">C2</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Metadata::read_optional_numeric</span><span class="plain-syntax">(</span><span class="identifier-syntax">mod2</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"^category"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">d</span><span class="plain-syntax"> = ((</span><span class="reserved-syntax">int</span><span class="plain-syntax">) </span><span class="identifier-syntax">C2</span><span class="plain-syntax">) - ((</span><span class="reserved-syntax">int</span><span class="plain-syntax">) </span><span class="identifier-syntax">C1</span><span class="plain-syntax">); </span><span class="comment-syntax"> larger values sort earlier</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">d</span><span class="plain-syntax"> != </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">d</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">E1</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax"> - </span><span class="identifier-syntax">E2</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">; </span><span class="comment-syntax"> smaller values sort earlier</span>
<span class="plain-syntax">}</span>

<span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="function-syntax">MakeSynopticModuleStage::module_containing</span><button class="popup" onclick="togglePopup('usagePopup7')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup7">Usage of <span class="code-font"><span class="function-syntax">MakeSynopticModuleStage::module_containing</span></span>:<br/>Verbs - <a href="5-vrb.html#SP2">&#167;2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">P</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pack</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterPackage::container</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterPackage::tree</span><span class="plain-syntax">(</span><span class="identifier-syntax">pack</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">while</span><span class="plain-syntax"> (</span><span class="identifier-syntax">pack</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ptype</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterPackage::type</span><span class="plain-syntax">(</span><span class="identifier-syntax">pack</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ptype</span><span class="plain-syntax"> == </span><span class="identifier-syntax">LargeScale::package_type</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_module"</span><span class="plain-syntax">)) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">pack</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">pack</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterPackage::parent</span><span class="plain-syntax">(</span><span class="identifier-syntax">pack</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<nav role="progress"><div class="progresscontainer">
    <ul class="progressbar"><li class="progressprev"><a href="4-tsk.html">&#10094;</a></li><li class="progresschapter"><a href="P-wtmd.html">P</a></li><li class="progresschapter"><a href="1-pm.html">1</a></li><li class="progresschapter"><a href="2-pp.html">2</a></li><li class="progresschapter"><a href="3-ps.html">3</a></li><li class="progresschapter"><a href="4-lbks.html">4</a></li><li class="progresscurrentchapter">5</li><li class="progresscurrent">msms</li><li class="progresssection"><a href="5-sh.html">sh</a></li><li class="progresssection"><a href="5-su.html">su</a></li><li class="progresssection"><a href="5-ext.html">ext</a></li><li class="progresssection"><a href="5-lt.html">lt</a></li><li class="progresssection"><a href="5-rsp.html">rsp</a></li><li class="progresssection"><a href="5-rls.html">rls</a></li><li class="progresssection"><a href="5-act.html">act</a></li><li class="progresssection"><a href="5-act2.html">act2</a></li><li class="progresssection"><a href="5-ins.html">ins</a></li><li class="progresssection"><a href="5-dlg.html">dlg</a></li><li class="progresssection"><a href="5-knd.html">knd</a></li><li class="progresssection"><a href="5-prp.html">prp</a></li><li class="progresssection"><a href="5-rlt.html">rlt</a></li><li class="progresssection"><a href="5-tbl.html">tbl</a></li><li class="progresssection"><a href="5-chr.html">chr</a></li><li class="progresssection"><a href="5-scn.html">scn</a></li><li class="progresssection"><a href="5-mlt.html">mlt</a></li><li class="progresssection"><a href="5-uo.html">uo</a></li><li class="progresssection"><a href="5-vrb.html">vrb</a></li><li class="progresssection"><a href="5-tst.html">tst</a></li><li class="progresschapter"><a href="6-erms.html">6</a></li><li class="progressnext"><a href="5-sh.html">&#10095;</a></li></ul></div>
</nav><!-- End of weave -->

		</main>
	</body>
</html>

